//
//  FeedbackViewController.m
//  Commerce
//
//  Created by xiaofeifei on 15/2/25.
//  Copyright (c) 2015年 fei. All rights reserved.
//

#import "FeedbackViewController.h"

@interface FeedbackViewController ()

@end

@implementation FeedbackViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.navStr = @"意见反馈";
    [_remarkBGImg setImage:[[UIImage imageNamed:@"remark.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(8,8,8,8)]];
    // Do any additional setup after loading the view from its nib.
}

- (IBAction)submitBtnAct:(id)sender {
    [SVProgressHUD showWithStatus:@"加载中" maskType:SVProgressHUDMaskTypeBlack];
    NSMutableDictionary *parameters = [GlobalData paramterDic];
    [parameters addEntriesFromDictionary:@{@"userid":[[GlobalData sharedGlobalData] userinfoDic][@"UserID"],@"bug":_textView.text}];
    NSLog(@"%@",parameters);
    
    [parameters addEntriesFromDictionary:@{@"dong_jing":[NSString stringWithFormat:@"%f",[[GlobalData sharedGlobalData] uselocation].longitude],@"bei_wei":[NSString stringWithFormat:@"%f",[[GlobalData sharedGlobalData] uselocation].latitude]}];
    NSLog(@"%@",parameters);
    [[BaseNetwork alloc] initWithMethodUrl:[NSString stringWithFormat:@"%@sys/cartype",URL_ROOT]
                                    params:parameters
                               requestMode:DGHTTPMethodPOST
                               loadingShow:YES
                              didFinshLoad:^(id result) {
                                  id responseObject = result;
                                  [SVProgressHUD dismiss];
                                  if ([responseObject[@"result"] integerValue] == 1) {
                                      [SVProgressHUD showSuccessWithStatus:@"感谢您提出的宝贵建议,我们会及时改善！"];
                                      [self backBtnAct:nil];
                                  }
                                  
                              }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
